package buildrobot_info

import (
	"go_server/game_server/protocol/pb"
	"go_server/game_server/util"
	"go_server/game_server/world_manager"
	"go_server/zinx/ziface"
	"go_server/zinx/zlog"
	"go_server/zinx/znet"
)

type Router_AddBuildRobotLvUp struct {
	znet.BaseRouter
}

func (*Router_AddBuildRobotLvUp) Handle(request ziface.IRequest) {
	conn := request.GetConnection()
	msg := &pb.AddRobot2BuildLvUpC2S{}
	if !util.PBParseRet(request, msg) {
		return
	}
	roleId, _ := conn.GetProperty("roleId")
	zlog.Debug("Router_AddBuildRobotLvUp")
	nRoleID := roleId.(int64)
	errCode := Buildrobot_info_serviceObj.S2C_AddBuildRobotLvUp(conn, nRoleID, msg)
	if errCode != pb.ErrorCodeManager_SUCCESS {
		world_manager.WorldMgrObj.SendClientErrMsg(nRoleID, request, errCode, nil)
	}
}
